string_column Derived Type

type, public, extends(data_column) :: string_column

Defines a column of string values.


Components

Type Visibility Attributes Name Initial
character(len=:), public, allocatable :: m_name

A header, or column name.


Constructor

public interface string_column

  • private pure function sc_init_empty(n) result(rst)

    Constructs an empty integer_column of the requested size.

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int32), intent(in) :: n

    The number of rows to create.

    Return Value type(string_column)

    The newly constructed string_column object.

  • private pure function sc_init_array(x) result(rst)

    Constructs a new string_column by copying the contents of the supplied array.

    Arguments

    Type IntentOptional Attributes Name
    type(string), intent(in), dimension(:) :: x

    The array to copy.

    Return Value type(string_column)

    The newly constructed string_column object.


Type-Bound Procedures

procedure, public :: append => sc_append

  • private subroutine sc_append(this, x)

    Arguments

    Type IntentOptional Attributes Name
    class(string_column), intent(inout) :: this
    class(*), intent(in) :: x

procedure, public :: copy => sc_copy

  • private pure subroutine sc_copy(this, dest)

    Copies the contents of this column to the supplied destination array.

    Arguments

    Type IntentOptional Attributes Name
    class(string_column), intent(in) :: this

    The string_column object.

    class(*), intent(inout), dimension(:) :: dest

    The destination array.

procedure, public :: count => sc_count

  • private pure function sc_count(this) result(rst)

    Gets the number of values stored in this column.

    Arguments

    Type IntentOptional Attributes Name
    class(string_column), intent(in) :: this

    The string_column object.

    Return Value integer(kind=int32)

    The number of values.

procedure, public :: get => sc_get

  • private pure function sc_get(this, row) result(rst)

    Gets the requested value from the column.

    Arguments

    Type IntentOptional Attributes Name
    class(string_column), intent(in) :: this

    The string_column object.

    integer(kind=int32), intent(in) :: row

    The row index of the value to retrieve.

    Return Value character(len=:), allocatable

    The value stored at the requested row.

procedure, public :: get_data_type => sc_get_type

  • private pure function sc_get_type(this) result(rst)

    Gets the type stored by this column.

    Arguments

    Type IntentOptional Attributes Name
    class(string_column), intent(in) :: this

    The string_column object.

    Return Value integer(kind=int32)

    The type stored by this column.

procedure, public :: get_name => dc_get_name

  • private pure function dc_get_name(this) result(rst)

    Gets the name associated with the column.

    Arguments

    Type IntentOptional Attributes Name
    class(data_column), intent(in) :: this

    The data_column object.

    Return Value character(len=:), allocatable

    The name.

procedure, public :: insert => sc_insert

  • private subroutine sc_insert(this, row, x)

    Arguments

    Type IntentOptional Attributes Name
    class(string_column), intent(inout) :: this
    integer(kind=int32), intent(in) :: row
    class(*), intent(in) :: x

procedure, public :: remove => sc_remove

  • private subroutine sc_remove(this, row)

    Arguments

    Type IntentOptional Attributes Name
    class(string_column), intent(inout) :: this
    integer(kind=int32), intent(in) :: row

procedure, public :: set => sc_set

  • private subroutine sc_set(this, row, x)

    Sets the requested value into the column.

    Arguments

    Type IntentOptional Attributes Name
    class(string_column), intent(inout) :: this

    The string_column object.

    integer(kind=int32), intent(in) :: row

    The row index.

    character(len=*), intent(in) :: x

    The value stored at the requested row.

procedure, public :: set_name => dc_set_name

  • private subroutine dc_set_name(this, x)

    Sets the name associated with the column.

    Arguments

    Type IntentOptional Attributes Name
    class(data_column), intent(inout) :: this

    The data_column object.

    character(len=*), intent(in) :: x

    The name.

procedure, public :: slice => sc_slice

  • private function sc_slice(this, first, last) result(rst)

    Returns a borrowed, mutable slice of this column's array.

    Arguments

    Type IntentOptional Attributes Name
    class(string_column), intent(inout), target :: this

    The string_column object.

    integer(kind=int32), intent(in) :: first

    The one-based starting index of the slice.

    integer(kind=int32), intent(in) :: last

    The one-based ending index of the slice.

    Return Value class(*), pointer, dimension(:)

    The array pointer, or null if unallocated.

procedure, public :: to_string => sc_to_string

  • private function sc_to_string(this, row, fmt) result(rst)

    Returns the value in the requested row as a string.

    Arguments

    Type IntentOptional Attributes Name
    class(string_column), intent(in) :: this

    The string_column object.

    integer(kind=int32), intent(in) :: row

    The row index.

    character(len=*), intent(in), optional :: fmt

    The formatting string.

    Return Value character(len=:), allocatable

    The resulting string.

procedure, public :: view => sc_view

  • private function sc_view(this) result(rst)

    Returns a borrowed, mutable view of this column's array.

    Arguments

    Type IntentOptional Attributes Name
    class(string_column), intent(inout), target :: this

    The string_column object.

    Return Value class(*), pointer, dimension(:)

    The array pointer, or null if unallocated.